feat(mcp): compose preflight, slop-risk, and pr-text-lint into review-pr - #3791
Conversation
Adds `gittensory-mcp review-pr` (and the matching `gittensory_review_pr_before_push` MCP tool) so a contributor's own local agent can run one command and see everything the gittensory gate would flag before ever opening a PR (#1968). It is a thin composition layer: it calls the existing preflight (analyzeCurrentBranch), POST /v1/lint/slop-risk, and POST /v1/lint/pr-text checks and merges their output into one report with an overallStatus and a per-check sections array. Each check is isolated so one flaky endpoint degrades only its own section (with a public-safe error reason) instead of losing the whole report. Also points doctor's default next-command guidance at review-pr instead of plain preflight, and documents the new command in the package README/help. Validated with npm run typecheck, npm run build:mcp, npm run test:mcp-pack, and npx vitest run across the mcp-cli-*.test.ts suite (89 passed) plus the full unit suite (9889 passed).
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
gittensory-ui | bba1bc7 | Commit Preview URL Branch Preview URL |
Jul 06 2026, 10:13 AM |
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3791 +/- ##
=======================================
Coverage 93.33% 93.33%
=======================================
Files 317 317
Lines 32433 32433
Branches 11892 11892
=======================================
Hits 30270 30270
Misses 1530 1530
Partials 633 633 🚀 New features to boost your workflow:
|
|
Tip 🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩 ✅ Gittensory review result - approve/merge recommendedReview updated: 2026-07-06 10:21:38 UTC
✅ Suggested Action - Approve/Merge
Review summary Nits — 6 non-blocking
Review context
Contributor next steps
Signal definitions
🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.
|
Summary
gittensory-mcp review-pr(and a matchinggittensory_review_pr_before_pushMCP tool) that composes the existingpreflight(analyzeCurrentBranch),POST /v1/lint/slop-risk, andPOST /v1/lint/pr-textchecks into ONE pre-PR review report, so a contributor's own local agent (Claude Code, Codex, etc.) can run one command and see everything the gittensory gate would flag before ever opening a PR.preflight/slop-risk/lint-pr-textalready call and merges their output into{ preflight, slopRisk, prTextLint, overallStatus, sections }.failwith a public-safe error reason (slopRiskError/prTextLintError) instead of losing the sections that did succeed — this fail-safe behavior has a dedicated regression test for each check.doctor's default "next command" fallback (shown when no other diagnostic is more urgent) now points atreview-prinstead of plainpreflight, since it is the superset check a contributor should run before opening a PR. Updated the two existing doctor tests that asserted the old exact command string.packages/gittensory-mcp/README.md(usage line + a dedicated "Review your PR locally before you push" section) and in the CLI's own--helpusage listing.Design note (conservative scope decision): the issue's example name was
predict-gate, but this package has nogittensory_predict_gatetool or/v1/predict-gate-style endpoint today — the closest existing "gate preflight" surface ispreflight/analyzeCurrentBranch, which is what's composed here alongside slop-risk and PR-text lint. No new backend endpoint was added; this is CLI/MCP-package-only, per the issue's explicit "thin composition, don't reimplement" instruction.Scope
type(scope): short summaryConventional Commit format, for examplefix(api): restore profile access checks.CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Validation
git diff --checknpm run actionlintnpm run typechecknpm run test:coveragelocally;codecov/patchrequires ≥99% coverage of the lines AND branches you changed (aim for 100% on your diff so CI variance does not fail near the threshold). Global coverage is a non-blocking trend with a loose 90% backstop, not the gate. — not run: this change touches onlypackages/gittensory-mcp/**(plain.js, outside Codecov'ssrc/**/*.tsinclude) andtest/**(Codecov-ignored), so it owes no patch coverage; ran the full unshardednpx vitest run test/unit/instead (490 files / 9889 tests passed) plus the new/changed MCP CLI test files directly.npm run test:workers— not run; this change does not touchtest/workers/**or any Cloudflare Worker code.npm run build:mcpnpm run test:mcp-packnpm run ui:openapi:check— not run; no API routes or OpenAPI schemas changed.npm run ui:lint/npm run ui:typecheck/npm run ui:build— not run; noapps/gittensory-ui/**files changed.npm audit --audit-level=moderatetest/unit/mcp-cli-review-pr.test.ts(8 new tests: pass, warn/weak-lint,--body-file, slop-risk API failure degradation, pr-text-lint API failure degradation, missing--login,--help, typo-suggestion) plus updatedtest/unit/mcp-cli-doctor.test.tsassertions for the new default next-command string.Safety
apiPostauth requirement unchanged).gittensory_review_pr_before_push, tested via the equivalent CLI command against the same composed function).UI Evidencesection below with JPG/JPEG or PNG screenshots... — N/A, no visible UI changes (CLI/MCP package only).CHANGELOG.mduntouched (generated at release).UI Evidence
N/A — no visible UI changes; this PR is scoped to the
@jsonbored/gittensory-mcpCLI/MCP package.Notes
npm run typecheck,npm run actionlint,npm audit --audit-level=moderate,npm run build:mcp,npm run test:mcp-pack,npm run command-reference:check,npm run docs:drift-checkall pass;npx vitest run test/unit/(490 files / 9889 tests) passes in full.